<script src="../js/equal.js"></script>
<script>
  // 1
  {
    const fn = (...rest, veryLast) => {
      console.assert(equal(rest, [1, 2]), `1. 不成立`);
    };
    fn(1, 2);
  }
  // 2
  {
    const fn = (firstParam, secondParam, rest) => {
      console.assert(equal(rest, [3,4]), `2. 不成立`);
    };
    fn(null, 2, 3, 4);
  }
  // 3
  {
    const fn = () => {
      console.assert(equal(args, [42, 'twenty three', 'win']), `3. 不成立`);
    };
    fn(42, 'twenty three', 'win');
  }
  // 4
  {
    const fn = () => args;
    const [firstArg, ...rest] = fn(1, 2, 3);
    console.assert(equal(rest, [2, 3]), `4. 不成立`);
  }
</script>
